<script>
export default {
  name: 'SvgIcon'
}
</script>
<script setup>
const { width, height, name, fill } = defineProps({
  width: {
    type: String || Number,
    default: '30px'
  },
  height: {
    type: String || Number,
    default: '30px'
  },
  prefix: {
    type: String,
    default: '#icon-'
  },
  name: {
    type: String,
    required: true
  },
  fill: String
})
</script>

<template>
  <svg
    :style="{
      width: isNaN(width) ? width : width + 'px',
      height: isNaN(height) ? height : height + 'px'
    }"
    :="$attrs"
  >
    <use
      :xlink:href="prefix + name"
      :fill="fill"
    />
  </svg>
</template>

<style scoped lang="scss">
// 开始
</style>
